package com.lxl;

public class Shopping {
    public static void main(String[] args) {
        Product p1 = new Product();
        Product p2 = new Product();
        Product p3 = new Product();
        Product p4 = new Product();
        Product p5 = new Product();
        p1.setProName("电视机");
        p2.setProName("洗衣机");
        p3.setProName("豆浆机");
        p4.setProName("空调机");
        p5.setProName("吹风机");

        Market market = new Market();
        market.setMarkerName("家乐福");
        market.setProducts(new Product[]{p1, p2, p3, p4, p5});

        Person person = new Person();
        person.setName("小韩");
        Product result = person.shopping(market, "空调机");

        if (result!=null){
            System.out.println("买到了");
        }else {
            System.out.println("白跑一趟");
        }
    }
}
